#include "ppsymbol.h"

namespace losor
{
	ppsymbol::ppsymbol( ppobject *parent ) :
		ppobject( "symbol", parent )
	{
		// TODO:
	}
	
	ppsymbol::~ppsymbol()
	{
		// TODO:
	}
	
	long ppsymbol::parser( code &_code )
	{
		unsigned char* ptr = _code.str;
		int flag;

		if( gword[*ptr] || *ptr == '_' || *ptr == '$' )
		{
			while( gword[*ptr] || gdec[*ptr] || '_' || '$' );
			m_caption = string( _code.str, ptr-_code.str );
			_code.str = ptr;
			if( gkeyword.find( m_caption ) != gkeyword.end() )
				m_type = "keyword";
			return 0;
		}
		return -1;
	}
}

